#include "Heap.h"

void test()
{
	heap hp;
	cout << "size = " << hp.size() << '\n';
	hp.push(4);
	cout << "\"push 4\"  top = " << hp.top();
	cout << "  size = " << hp.size() << '\n';
	hp.push(5);
	cout << "\"push 5\"  top = " << hp.top();
	cout << "  size = " << hp.size() << '\n';
	hp.push(6);
	cout << "\"push 6\"  top = " << hp.top();
	cout << "  size = " << hp.size() << '\n';
	hp.push(3);
	cout << "\"push 3\"  top = " << hp.top();
	cout << "  size = " << hp.size() << '\n';
	hp.pop();
	cout << "\"pop\"     top = " << hp.top();
	cout << "  size = " << hp.size() << '\n';
	hp.push(6);
	cout << "\"push 6\"  top = " << hp.top();
	cout << "  size = " << hp.size() << '\n';
	hp.push(10);
	cout << "\"push 10\" top = " << hp.top();
	cout << "  size = " << hp.size() << '\n';
	hp.push(7);
	cout << "\"push 7\"  top = " << hp.top();
	cout << "  size = " << hp.size() << '\n';
	hp.push(24);
	cout << "\"push 24\" top = " << hp.top();
	cout << "  size = " << hp.size() << '\n';
	while (!hp.empty())
	{
		hp.pop();
		cout << "\"pop\"     top = " << hp.top();
		cout << "  size = " << hp.size() << '\n';
	}
}

void HeapSortTest()
{
	int *a, t;
	cin >> t;
	a = (int *)malloc(t * sizeof(int));
	for (int i = 0; i < t; i++)
		cin >> a[i];
	HeapSort(a, a + t);
	for (int i = 0; i < t; i++)
		cout << a[i] << ' ';
}

int main()
{
	//HeapSortTest();
	 test();
	cout << "over\n";
	return 0;
}